<template>
    <div>
      <!-- 面包屑导航 -->
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>职位管理</el-breadcrumb-item>
        <el-breadcrumb-item>添加职位</el-breadcrumb-item>
      </el-breadcrumb>
      <!-- 卡片视图区域 -->
      <el-card>
        <el-form ref="jobform" label-width="80px" size="mini" :model="jobform">
  
          <el-row :gutter="20">
            <el-col :span="6">
              <el-form-item label="职位名称:">
                <el-input v-model="jobform.name"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="6">
              <el-form-item label="职位备注:">
                <el-input v-model="jobform.remark"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="2">
              <el-form-item>
                <el-button type="primary" size="small" @click="jobaddbtn"
                  >添加</el-button
                >
              </el-form-item>
            </el-col>
            <el-col :span="2">
              <el-form-item>
                <!-- 返回原来的页面 -->
                <el-button type="warning" size="small" @click="goback"
                  >返回</el-button
                >
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-card>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
          jobform: {}
      }
    },
    methods: {
      async jobaddbtn() {
        console.log(this.jobform);
        const { data: res } = await this.$http.post("/job/add", this.jobform);
        if (res.code == 200) {
          this.$message.success(res.message);
        } else {
          this.$message.error(res.message);
        }
        this.$router.push("/job");
      },
      goback() {
        window.history.back();
      },
    },
  };
  </script>
  
  <style></style>
  